package com.diy.sigmund.diyuser.common.spring.config.oauth2;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author ylm-sigmund
 * @since 2021/8/24 21:06
 */
@Component
public class OAuth2UrlConfig {

    /** password */
    // public static final String PASSWORD_TYPE = "?grant_type=password&username={username}&password={password}&scope=all";
    public static final String PASSWORD_TYPE = "?grant_type=password&username=%s&password=%s&scope=all";
    /** refresh_token */
    // public static final String REFRESH_TOKEN_TYPE = "?grant_type=refresh_token&refresh_token={refresh_token}";
    public static final String REFRESH_TOKEN_TYPE = "?grant_type=refresh_token&refresh_token=%s";

    /** "/oauth/token" */
    @Value("${security.oauth2.client.access-token-uri}")
    private String accessTokenUri;

    public String getAccessTokenUri() {
        return accessTokenUri;
    }
}
